<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/dateRange.css"/>
		<link rel="stylesheet" type="text/css" href="css/monthPicker.css"/>
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
		<title></title>
	</head>
	<body>
		<div class="bj">
		<!--头部-->
		<div class="head">
			<div class="h-top">
				<ul>
					<li><a href="#">营销应用</a><span> | </span></li>
					<li><a href="#">基本设置</a><span> | </span></li>
					<li><a href="#">装修设置</a><span> | </span></li>
					<li><a href="#">帮助中心</a></li>
				</ul>
				<div class="clear"></div>
			</div>
			<div class="h-name">
				<div class="name">
					<div class="logo left">
						<a href="#"><img src="img/logo.png" style="height: 40px;"/></a>
					</div>
					<div class="assistant right">
						<div class="img">
							<img src="img/assistant.png"/>
						</div>
						<div class="b-div">
							<img src="img/assistant.png"/>
							<p class="t1">zhuolizs</p>
							<p class="t2"><a href="">账号设置</a></p>
							<p class="t2"><a href="">退出登录</a></p>
						</div>
					</div>
					<div class="assistant right">
						<div class="img">
							<img src="img/assistant.png"/>
						</div>
						<div class="b-div">
							<img src="img/assistant.png"/>
							<p class="t1">匿名小程序</p>
							<p class="t2"><a href="">切换小程序</a></p>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!--内容-->
		<div class="c">
			<div class="content">
				<div class="c-l left">
					<div class="c-left">
					<div class="list">
						<div class="">
							<i></i><span>酒店信息管理</span>
						</div>
						<ul>
							<li class="act"><a href="information.html">酒店信息管理</a></li>
						</ul>
						
					</div>
					
						<div class="list">
						<div class="">
							<i></i><span>图片管理</span>
						</div>
						<ul>
							<li><a href="slide.html">图片管理</a></li>
						</ul>
						
					</div>
					
					<div class="list">
						<div class="">
							<i></i><span>产品管理</span>
						</div>
						<ul>
							<li><a href="product-fl.html">分类管理</a></li>
							<li><a href="product-gl.html">产品管理</a></li>
							<li><a href="product-fj.html">酒店房间管理</a></li>
							<li><a href="product-xj.html">酒店下架房间管理</a></li>
						</ul>
					</div>
					
					<div class="list">
						<div class="">
							<i></i><span>会员管理</span>
						</div>
						<ul>
							<li><a href="member.html">会员列表</a></li>
							<li><a href="member-del.html">删除会员列表</a></li>
						</ul>
					</div>
					
					<div class="list">
						<div class="">
							<i></i><span>订单管理</span>
						</div>
						<ul>
							<li><a href="order.html">会员未入住列表</a></li>
							<li><a href="order-a.html">会员已入住列表</a></li>
						</ul>
						
					</div>
					
					<div class="list">
						<div class="">
							<i></i><span>管理员设置</span>
						</div>
						<ul>
							<li><a href="user.html">管理员列表</a></li>
							<li>删除管理员列表</li>
						</ul>
						
					</div>
					</div>
				
				</div>
				
				<div class="c-r right">
					<div class="label1">
						<div class="title">
							添加产品
						</div>
						<div class="form" id="form">
							<form action="index.html" method="get">
								<div>
									<label class="ltxt">分类名称:</label>
									<div class="bor bor6 bor0" >
											<span>请选择</span><i></i>
											<ul style="display: none;">
											</ul>
									</div>
									<div class="bor bor7 bor0">
											<span>请选择</span><i></i>
											<ul style="display: none;">
											</ul>
									</div>
									<div class="bor bor8 bor0">
											<span>请选择</span><i></i>
											<ul style="display: none;">
											</ul>
									</div>
									<span></span>
								</div>
								<div><label class="">图片:</label><input type="file" name="img" id="img" value="" style="border: 1px solid #d7dde4;padding: 5px 7px;width: 194px;"/><span></span></div>
								<div class="txtname"><label class="">分类名:</label><input type="text" name="txt" id="txt" value="" style="width: 194px;"/><span></span></div>
								<input type="hidden" name="class_one" id="class_one" value="" />
								<input type="hidden" name="class_two" id="class_two" value="" />
								<input type="hidden" name="class_three" id="class_three" value="" />
								<div><button class="btns">保存</button></div>
								<div class="clear"></div>
							</form>
						</div>
					</div>
				</div>
				<!--<div id="main" style="width: 600px;height:400px;"></div>-->
			</div>
			
		</div>
		<div class="asd" style="display: none;">
			1231
		</div>
		<!--尾部-->
		<div class="foot">
			Copyright © 2016 - 2017 qingful.com All Rights Reserved
		</div>
		<!--返回顶部-->
		<div id="toup">
			<img src="img/toup.png"/>
		</div>
	</div>
	</body>
</html>
<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/js.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">


	var Ptid_one = $("#class_one");   //获取每级id
	var Ptid_tow = $("#class_two");  
	var Ptid_three = $("#class_three");   
	var Level = "0";   //获取级别
	
	
	$(".bor6").unbind('click').bind('click',function(){
		$(".bor7 ul li").remove()
		//alert('-')
		var	are = '';
		$.ajax({
			type:"get",
			url:"data/select.json",
			data: '',
			dataType: "json",
			success: function(data){
				//alert(data[1].title)
				for (var i = 0; i < data.length; i++){      //一级分类
					//alert(data[i].title)
					are += "<li data-type="+data[i].ptid+">"+data[i].name+"</li>";
					Level = data[i].level
					//console.log(Level)
					//$(".bor6 ul").html('')
					//alert('1')
					//alert($(".bor6 ul").html('666'))
//						for (var j = 0; j < data[i].sub.length; j++) {   //二级菜单
//							//alert(data[i].sub[j].title)
//						}
			}
				$(".bor6 ul").html('')
				$(".bor6 ul").append(are)
			},
			error:function(){
				alert('失败')
			}
		});
	})
	
	var Li;  				//一级索引
	var towLi;				//二级索引
	//二级分类
	$(document).on("click", ".bor6 ul li", function(){
		$(".txtname").show()
		$(".bor7 ul li").remove()
		$(".bor7 span").text('请选择')
		$(".bor8 ul li").remove()
		$(".bor8 span").text('请选择')
		Li = $(this).index()
		var	are = '';
		$.ajax({
				type:"get",
				url:"data/select.json",
				data: '',
				dataType: "json",
				success: function(data){
					for (towLi = 0; towLi < data[Li].sub.length; towLi++) {   //二级菜单
						are += "<li data-type="+data[Li].sub[towLi].ptid+">"+data[Li].sub[towLi].name+"</li>"
						Level = data[Li].sub[towLi].level
					}
					$(".bor7 ul").html('')
					$(".bor7 ul").append(are)
					//console.log(Level)
				},
				error:function(){
					alert('失败')
				}
		});		
	})
	
	//三级分类
	$(document).on("click", ".bor7 ul li", function(){
		$(".txtname").show()
		$(".bor8 ul li").remove()
		$(".bor8 span").text('请选择')
		var stowLi = $(this).index()
		var	are = '';
		$.ajax({
				type:"get",
				url:"data/select.json",
				data: '',
				dataType: "json",
				success: function(data){
					for (var i = 0; i < data[Li].sub[stowLi].sub.length; i++) {   //三级菜单
						//alert(data[Li].sub[stowLi].sub[i].title)
						are += "<li data-type="+data[Li].sub[stowLi].sub[i].ptid+">"+data[Li].sub[stowLi].sub[i].name+"</li>"
						Level = data[Li].sub[stowLi].sub[i].level
					}
					$(".bor8 ul").html('')
					$(".bor8 ul").append(are)
					//console.log(Level)
				},
				error:function(){
					alert('失败')
				}
			});
	})
	
	$(document).on("click", ".bor8 ul li", function(){
		$(".txtname").hide()
	})
	
	function Oneajax(obj){
		var	are = '';
		$.ajax({
			type:"get",
			url:"data/select.json",
			data: obj,
			dataType: "json",
			success: function(data){
				//alert(data[1].title)
				for (var i = 0; i < data.length; i++){      //一级菜单
					//alert(data[i].title)
					are += "<li>"+data[i].name+"</li>"
					//$(".bor6 ul").html('')
					//alert('1')
					//alert($(".bor6 ul").html('666'))
//						for (var j = 0; j < data[i].sub.length; j++) {   //二级菜单
//							//alert(data[i].sub[j].title)
//						}
			}
				$(".bor6 ul").html('')
				$(".bor6 ul").append(are)
				console.log(Li+"----------"+stowLi)
				
			},
			error:function(){
				alert('失败')
			}
		});
		//}
		//return false;
	}
	
	
	$(".btns").click(function(){
		if ($(".bor6 span").text() != "请选择") {
			
			Ptid_one.val($(".bor6 span").attr('data-type'))
			if ($(".bor7 span").text() != "请选择"){
				Ptid_tow.val($(".bor7 span").attr('data-type'))
			}
		} else{
			//return false
			//console.log("****")
		}
		
		//Ptid += $(".bor7 span").attr('data-type')
		//console.log("级别："+Ptid+" 级数："+Level)
		//return false
	})

</script>














